import paramiko


def send_report(order_number):
    # 远程服务器的地址和端口
    hostname = '111.173.119.83'
    port = 22

    # 远程服务器的用户名和密码
    username = 'root'
    password = 'Hh*834258368'

    # 远程文件路径和本地文件路径
    remote_path = '/mnt/nas/report/samereport_' + order_number+'.zip'
    local_path = '/mnt/report/samereport_' + order_number+'.zip'

    # 创建 SSH 客户端
    ssh_client = paramiko.SSHClient()

    # 自动添加远程服务器的主机密钥
    ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())

    # 连接到远程服务器
    ssh_client.connect(hostname, port=port, username=username, password=password)

    # 创建 SCP 客户端
    scp_client = ssh_client.open_sftp()

    # 从远程服务器下载文件到本地系统
    scp_client.put(local_path, remote_path)

    # 关闭 SCP 客户端和 SSH 客户端
    scp_client.close()
    ssh_client.close()


if __name__ == '__main__':
    send_report('81680919109766')
